<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>小灰在线答题登录界面</title>
<link rel="stylesheet" type="text/css" href="../css/style.css" />
<link rel="stylesheet" type="text/css" href="../css/body.css"/>
	<script src="../js/jquery.js"></script>
	<script>
		function login() {
			var email = $('#email').val()
			var password = $('#password').val()
			if (email == ''){
				alert('邮箱不能为空');
			} else if(password == ''){
				alert('密码不能为空');
			}else if(email.length > 20){
				alert('邮箱过长！');
			}else if(password.length > 50){
				alert('密码过长！');
			}else{
				$.post('../selAdminByEmailPwd',{email:email,password:password},function (result) {
					if (result == 1){
						window.location.href='home.html';
					} else{
						alert('密码或邮箱错误！');
					}
				})
			}
		}
	</script>
</head>
<body>
<div class="container">
	<section id="content">
		<form>
			<h1>管理员登录</h1>
			<div>
				<input type="text" placeholder="邮箱" required="" id="email" />
			</div>
			<div>
				<input type="password" placeholder="密码" required="" id="password" />
			</div>
			 <div class="">
				<span class="help-block u-errormessage" id="js-server-helpinfo">&nbsp;</span>			</div>
			<div>
				<!-- <input type="submit" value="Log in" /> -->
				<input type="submit" value="登录" class="btn btn-primary" id="js-btn-login" onclick="login();return false;"/>

			</div>
		</form><!-- form -->
	</section><!-- content -->
</div>
<!-- container -->


<br><br><br><br>
<div style="text-align:center;">
<p>Copyright © xiaohui - <a href="http://www.miitbeian.gov.cn/">粤ICP备19017771号</a></p>
</div>
</body>
</html>